<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../vue.global.js"></script>
</head>
<body>
<div id="app"></div>
<script>
    const app = Vue.createApp({
        data() {
            return {
                count: 22
            }
        },
        methods: {
            handleAddOne(param){
                this.count += param
            }
        },
        template: `
          <counter :count="count" @add-one="handleAddOne"/>
        `
    });

    app.component('counter',{
        props:['count'],
        methods:{
            addOne(){
              this.$emit('addOne',6)
            }
        },
        template:`
         <div @click="addOne">{{count}}</div>
        `
    })
    const vm = app.mount("#app");
</script>
</body>
</html>